package org.scauinfo.fpos.vo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Tableplate entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "tableplate", catalog = "db_fpos")
public class Tableplate implements java.io.Serializable {

	// Fields

	private Integer id;
	private Integer tablePlate;
	private Integer tableState;
	private Set<Saleorder> saleorders = new HashSet<Saleorder>(0);

	// Constructors

	/** default constructor */
	public Tableplate() {
	}

	/** minimal constructor */
	public Tableplate(Integer tablePlate) {
		this.tablePlate = tablePlate;
	}

	/** full constructor */
	public Tableplate(Integer tablePlate, Integer tableState,
			Set<Saleorder> saleorders) {
		this.tablePlate = tablePlate;
		this.tableState = tableState;
		this.saleorders = saleorders;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "table_plate", nullable = false)
	public Integer getTablePlate() {
		return this.tablePlate;
	}

	public void setTablePlate(Integer tablePlate) {
		this.tablePlate = tablePlate;
	}

	@Column(name = "table_state")
	public Integer getTableState() {
		return this.tableState;
	}

	public void setTableState(Integer tableState) {
		this.tableState = tableState;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tableplate")
	public Set<Saleorder> getSaleorders() {
		return this.saleorders;
	}

	public void setSaleorders(Set<Saleorder> saleorders) {
		this.saleorders = saleorders;
	}

}